package hu.mapro.flang.gwt.client.ui.book;

import hu.mapro.flang.gwt.domain.client.AutoBeans.BookProxy;

import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.Editor;
import com.google.gwt.editor.client.SimpleBeanEditorDriver;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.ResizeComposite;
import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.widget.core.client.form.TextField;

public class BookPanel extends ResizeComposite implements Editor<BookProxy> {

	interface Binder extends UiBinder<Widget, BookPanel> {
	}

	interface Style extends CssResource {
		String menuItemSelected();
	}
	
	private static final Binder binder = GWT.create(Binder.class);

	@UiField
	TextField title;

	interface Driver extends SimpleBeanEditorDriver<BookProxy, BookPanel> {}
	
	Driver driver = GWT.create(Driver.class);
	
	public BookPanel() {
		initWidget(binder.createAndBindUi(this));
		
		driver.initialize(this);
	}

	void edit(BookProxy o) {
		driver.edit(o);
	}

	public void save() {
		driver.flush();
	}
}
